use rbatis::DateTimeNative;
use serde_derive::Deserialize;
use serde_derive::Serialize;

use crate::rbatis::crud_table;

#[crud_table]
#[derive(Debug, Deserialize, Serialize)]
pub struct UserRole {
    pub id: Option<u64>,
    pub user_id: Option<u64>,
    pub role_id: Option<u64>,
    pub default_role_id: Option<u64>,
    pub create_time: Option<DateTimeNative>,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct UserRolesReq {
    pub user_id: u64,
    pub roles_id: Vec<u64>,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct DefaultRole {
    pub user_id: u64,
    pub default_role_id: u64,
}